home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / inn1.000 / inn1.4sec-linux-src.tar / inn / Makefile < prev    next >
Makefile  |  1993-03-18  |  3KB  |  115 lines

  1. ##  $Revision: 1.33 $
  2. SHELL    = /bin/sh
  3. MAKE    = make
  4.  
  5. ##  The first two directories must be config and lib.
  6. PROGS    = config lib frontends innd nnrpd backends expire doc
  7. DIRS    = $(PROGS) site
  8.  
  9. ##  We invoke an extra process and set this to be what to make.
  10. WHAT_TO_MAKE    = all
  11.  
  12. ##  Delete the first two lines and all lines that contain (Directory).
  13. ##  Print only the first field of all other lines.  This gets us just
  14. ##  the list of files from the MANIFEST.
  15. SEDCOMMANDS = -e 1,2d -e '/(Directory)/d' -e 's/ .*//'
  16.  
  17. ##  Major target -- install library, build everything else.
  18. all:
  19.     @for D in $(DIRS) ; do \
  20.         TARGET=$(WHAT_TO_MAKE); \
  21.         case $$D in lib) TARGET=install ;; esac ; \
  22.         echo "" ; \
  23.         echo "cd $$D ; $(MAKE) $(FLAGS) $$TARGET ; cd .." ; \
  24.         cd $$D; $(MAKE) $(FLAGS) $$TARGET ; cd .. ; \
  25.     done
  26.  
  27. ##  Install everything.
  28. install:    directories
  29.     $(MAKE) $(FLAGS) WHAT_TO_MAKE=install common
  30.     @echo Do not forget to update your cron entries.
  31.     @echo Also run makehistory if you have to.
  32.  
  33. ##  Directories where files get put.
  34. directories:
  35.     $(SHELL) ./makedirs.sh
  36.  
  37. ##  Other generic targets.
  38. lint depend tags ctags profiled:
  39.     @$(MAKE) $(FLAGS) WHAT_TO_MAKE=$@ common
  40.  
  41. clean:
  42.     @$(MAKE) $(FLAGS) WHAT_TO_MAKE=$@ common
  43.     rm -f libinn.a libinn_p.a llib-linn.ln FILELIST
  44.  
  45. ##  Common target.
  46. common:
  47.     @for D in $(DIRS) ; do \
  48.         echo "" ; \
  49.         echo "cd $$D ; $(MAKE) $(FLAGS) $(WHAT_TO_MAKE) ; cd .." ; \
  50.         cd $$D; $(MAKE) $(FLAGS) $(WHAT_TO_MAKE) ; cd .. ; \
  51.     done
  52.  
  53. ##  Software update -- install just the programs and documentation.
  54. update:
  55.     @for D in $(PROGS) ; do \
  56.         echo "" ; \
  57.         echo "cd $$D ; $(MAKE) $(FLAGS) install ; cd .." ; \
  58.         cd $$D; $(MAKE) $(FLAGS) install ; cd .. ; \
  59.     done
  60.  
  61. ##  Build subst (for configuration).
  62. subst c sh quiet sedtest:
  63.     cd config ; $(MAKE) $(FLAGS) $@ ; cd ..
  64.  
  65. ##  Build installation document.
  66. Install.ms:    Install.ms.1 Install.ms.2
  67.     @rm -f Install.ms
  68.     cat Install.ms.1 Install.ms.2 >Install.ms
  69.     chmod 444 Install.ms
  70.  
  71. ##  Additional cleanups.
  72. clobber realclean:    clean
  73.     @echo ""
  74.     rm -f Install.ms inn*.tar.Z Part0? MANIFEST.BAK
  75.     rm -rf inews.* rnews.* nntplib.*
  76.     rm -f lib/dbz.c include/dbz.h doc/dbz.3z
  77.     rm -f tags */tags core */core a.out */a.out foo */foo
  78.     @echo ""
  79.     cd site ; make clobber ; cd ..
  80.  
  81. ##  Update syslog.
  82. syslogfix:
  83.     rm -f include/syslog.h lib/syslog.c
  84.     cp syslog/syslog.h include
  85.     cp syslog/syslog.c lib
  86.     cp syslog/syslog.3 doc
  87.     -cd syslog; $(CC) -o syslogd syslogd.c ; cd ..
  88.     @echo "Install syslogd and syslog.conf as appropriate"
  89.  
  90. ##  Configure, compile, and lint.
  91. world:        Install.ms
  92.     cd config ; $(MAKE) $(FLAGS) subst quiet ; cd ..
  93.     cd lib ; $(MAKE) $(FLAGS) lint ; cd ..
  94.     cat lib/lint
  95.     cd lib ; $(MAKE) $(FLAGS) install ; cd ..
  96.     $(MAKE) $(FLAGS) lint
  97.  
  98. ##  Make a distribution.
  99. shar:
  100.     makekit -m -k40 -s70k
  101. tar:
  102.     rm -f inn*.tar.Z
  103.     @rcs -l MANIFEST
  104.     makekit -m -k40 -s70k -x
  105.     tar cf inn.tar `sed $(SEDCOMMANDS) <MANIFEST`
  106.     compress inn.tar
  107.     mv inn.tar.Z inn`date +%m%d`.tar.Z
  108.  
  109. ##  Local convention; for xargs.
  110. list:    FORCE
  111.     @sed $(SEDCOMMANDS) <MANIFEST >FILELIST
  112. FORCE:
  113.  
  114. # DO NOT DELETE THIS LINE -- make depend depends on it.
  115.